package com.ld.shieldsb.verifycode;

import java.awt.FontFormatException;
import java.io.IOException;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@WebServlet("/verifyCode")
public class VerifyCodeController extends HttpServlet {
    /**
     * @Fields serialVersionUID
     */
    private static final long serialVersionUID = -637772820452461037L;
    public static final Logger log = LoggerFactory.getLogger(VerifyCodeController.class);

    // 验证码
    @Override
    public void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException {
        // 生成验证码，并将验证码保存到session中
        try {
            VerifyCodeUtil.out(httpServletRequest, httpServletResponse);
        } catch (FontFormatException e) {
            log.error("", e);
        }
    }

}
